<?php
function toDate($time, $format = 'Y-m-d H:i:s') {
    if (!empty($time)) {
        $format = str_replace('#', ':', $format);
        return date($format, $time);
    }
}
?>